<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表</title>
    <style>
        table {
            width: 80%;
            margin-left: 10%;
            text-align: center;
            border-collapse: collapse; /*合并边框线*/
            margin-top: 20px;
            font-size: 10px;
        }

        table, td, th {
            border: 1px #999 solid;
        }

        a {
            text-decoration: none;
            color: black;
        }

        .btn {
            display: inline-block;
            background-color: red;
            color: white;
            text-align: center;
            width: 100px;
            height: 30px;
            line-height: 30px;
        }

        tr {
            height: 40px;
        }

    </style>
</head>
<body>
<table class="layui-table">
    <tr>
        <td>书名</td>
        <td>作者</td>
        <td>出版社</td>
        <td>价格</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${booklist}" var="book">
<%--        这是一行--%>
        <tr>
            <td>${book.bname}</td>
            <td>${book.author}</td>
            <td>${book.press}</td>
            <td>${book.price}</td>
            <td><a href="/book/addCar?bid=${book.id}" class="btn" onclick="alert('success')">加入购物车</a></td>
        </tr>
    </c:forEach>
</table>
</body>
</html>

